<template>
  <div id="qrCode">
    <van-nav-bar class="nav" title="我的二维码" left-arrow @click-left="onClickLeft()" fixed placeholder></van-nav-bar>
    <div class="main">
      <div class="name">{{form.name}}</div>
      <div class="codeImg">
        <img :src=" apiConfig.imgUrl + 'uploadfile/ma/ma_' + form.id + '.png?v=' + apiConfig.v" alt />
      </div>
      <div class="baocun" >长按保存二维码</div>
    </div>
  </div>
</template>
  
  <script>
import apiConfig from "../../../config/api.config";
export default {
  data() {
    return {
      apiConfig,
      form: "",
    };
  },
  methods: {
     onClickLeft() {
      this.$router.go(-1); //返回上一层
    },
  },
 
  created() {
    let form = localStorage.getItem("form");
    this.form = JSON.parse(form);
    console.log(this.form);
  },
};
</script>
  
  <style lang="less">
#qrCode {
  width: 100vw;
  height: 100vh;
  text-align: left;
  color: #404040;
  background: #427df2;
  display: flex;
  align-items: center;
  .nav,.van-nav-bar{
    background: #427df2;
    .van-nav-bar__left i {
      color: #fff;
      font-style: 16px;
    }
    .van-nav-bar__title {
      font-size: 18px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: rgba(255, 255, 255, 1);
    }
  }
  .nav::after {
    border: none;
  }
  .main {
    width: 345px;

    padding: 52px 71px;
    background: rgba(255, 255, 255, 1);
    border-radius: 3px;
    margin: 25px auto 0;
    .name {
      text-align: center;
      font-size: 26px;
      font-family: PingFangSC-Medium, PingFang SC;
      font-weight: 500;
      color: rgba(64, 64, 64, 1);
      line-height: 37px;
    }
    .codeImg {
      width: 204px;
      height: 205px;
      margin: 22px auto 0;
      img {
        width: 100%;
        height: 1005;
      }
    }
    .baocun {
      text-align: center;
      margin-top: 37px;
      font-size: 18px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: rgba(54, 96, 200, 1);
      line-height: 25px;
      text-decoration: underline;
    }
  }
}
</style>
  